The UI_DLG_BOX Command
Description
Prerequisites and examples relating to the UI_DLG_BOX() Command.
Prerequisites
Before reading this tutorial, you should have a basic understanding of how to create scripts in Xbasic. If you do not know how to program with Xbasic, there are several resources that you might find helpful:
Learning Xbasic
Xbasic Reference
AlphaSports Explained
UI_DLG_BOX()
The UI_DLG_BOX() command displays a dialog box. The command has a simple format:
Result = ui_dlg_box( Title as C, Dialog_Format as C [, Code as C ] )
The Title parameter is the title of the dialog.
The Dialog_Format parameter is a string of Xdialog commands that describe the appearance of the dialog box.
The Code parameter is optional. It describes what should happen when various events happen when the user is interacting with the dialog box. For example, what should happen when the user presses a button, or when the user tabs out of a field.
The Result string contains the value returned by the dialog. This is typically the name of the button that was pressed to close the dialog.
Here is an example of an extremely simple Xdialog. It just creates a dialog box with the text "Hello World."
ui_dlg_box("Title","Hello World")Here is what this dialog box looks like:
Creating a dialog box with Xdialog is an interactive process. It is very easy to type in an Xdialog command in either the Interactive Window, or in a script, and then test the dialog. Then, refine the dialog and test it again. Try this by opening the Interactive window and typing in the above command.
See Also
